home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / Quill / Source / IncludeViewEditor.cpp < prev    next >
Text File  |  1997-02-20  |  3KB  |  125 lines

  1. /*
  2.  *  File:       IncludeViewEditor.cpp
  3.  *  Summary:       A view that knows how to edit a TIncludeView.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->    12/01/96    JDJ        Created
  12.  */
  13.  
  14. #include "IncludeViewEditor.h"
  15.  
  16. #include <ZTextBox.h>
  17.  
  18.  
  19. // ===================================================================================
  20. //    class CEditIncludeViewCommand
  21. // ===================================================================================
  22.  
  23. //---------------------------------------------------------------
  24. //
  25. // CEditIncludeViewCommand::~CEditIncludeViewCommand
  26. //
  27. //---------------------------------------------------------------
  28. CEditIncludeViewCommand::~CEditIncludeViewCommand()
  29. {
  30. }
  31.  
  32.  
  33. //---------------------------------------------------------------
  34. //
  35. // CEditIncludeViewCommand::CEditIncludeViewCommand
  36. //
  37. //---------------------------------------------------------------
  38. CEditIncludeViewCommand::CEditIncludeViewCommand(TIncludeView* pane, const SIncludeViewInfo& oldInfo, const SIncludeViewInfo& newInfo) : Inherited(pane, oldInfo, newInfo)
  39. {
  40. }
  41.  
  42.  
  43. //---------------------------------------------------------------
  44. //
  45. // CEditIncludeViewCommand::UpdatePane
  46. //
  47. //---------------------------------------------------------------
  48. void CEditIncludeViewCommand::UpdatePane(const SIncludeViewInfo& info)
  49. {
  50.     mPane->SetID(info.viewID);
  51. }
  52.  
  53. #pragma mark -
  54.  
  55. // ===================================================================================
  56. //    CIncludeViewEditor
  57. // ===================================================================================
  58.  
  59. static TReanimatorRegister<CIncludeViewEditor> sIncludeViewEditorRegistrar;
  60.  
  61. //---------------------------------------------------------------
  62. //
  63. // CIncludeViewEditor::~CIncludeViewEditor
  64. //
  65. //---------------------------------------------------------------
  66. CIncludeViewEditor::~CIncludeViewEditor()
  67. {
  68. }
  69.  
  70.  
  71. //---------------------------------------------------------------
  72. //
  73. // CIncludeViewEditor::CIncludeViewEditor
  74. //
  75. //---------------------------------------------------------------
  76. CIncludeViewEditor::CIncludeViewEditor(TView* superView) : Inherited(superView)
  77. {
  78. }
  79.  
  80.  
  81. //---------------------------------------------------------------
  82. //
  83. // CIncludeViewEditor::Create                            [static]
  84. //
  85. //---------------------------------------------------------------
  86. MReanimatable* CIncludeViewEditor::Create(MReanimatable* parent)
  87. {
  88.     return new CIncludeViewEditor(dynamic_cast<TView*>(parent));
  89. }
  90.  
  91.  
  92. //---------------------------------------------------------------
  93. //
  94. // CIncludeViewEditor::GetEditorInfo        
  95. //
  96. //---------------------------------------------------------------
  97. SIncludeViewInfo CIncludeViewEditor::GetEditorInfo() const
  98. {
  99.     SIncludeViewInfo info;
  100.     
  101.     TTextBox* textBox = nil;
  102.         
  103.     textBox = dynamic_cast<TTextBox*>(this->FindSubPane("View ID"));
  104.     info.viewID = textBox->GetValue();
  105.     
  106.     return info;
  107. }
  108.  
  109.  
  110. //---------------------------------------------------------------
  111. //
  112. // CIncludeViewEditor::SetEditorInfo
  113. //
  114. //---------------------------------------------------------------
  115. void CIncludeViewEditor::SetEditorInfo(const SIncludeViewInfo& info)
  116. {
  117.     TTextBox* textBox = nil;
  118.     
  119.     textBox = dynamic_cast<TTextBox*>(this->FindSubPane("View ID"));
  120.     textBox->SetValue(info.viewID);
  121. }
  122.  
  123.  
  124.  
  125.